import Vue from "vue";
import Route from "vue-router";
// import HelloWorld from '../components/HelloWorld.vue'
Vue.use(Route)
export default new Route({
  routes: [
    {
      path: '/',
      redirect: '/login',
      name:'首页',
      hidden:true,//添加字段 判断是否显示
      //  component:HelloWorld
      component: () => import('@/views/Login')  //路由懒加载
      // component: resolve => require (['@/views/Login'], resolve) //异步
    },
    {
      path: '/login',
      name: 'Login',
      hidden:true,
      component: () => import('@/views/Login')
    },
    {
      path: '*',
      name: '404',
      hidden:true,
      component: () => import('@/views/404')
    },
    {
      path: '/hello',
      component: () => import('@/components/HelloWorld'),
      // component: resolve => require (['@/components/HelloWorld'], resolve) //异步
      name: '学生管理',
      redirect:'/hello/student', //重定向
      iconClass: 'fa fa-users',//自定义图标
      children: [
        {
          path: '/hello/student',
          component: () => import('@/views/students/StudentList'),
          name: '学生列表',
          iconClass: 'fa fa-list',
        },
        {
          path: '/hello/info',
          component: () => import('@/views/students/InfoList'),
          name: '信息列表',
          iconClass: 'fa fa-list-alt',
        },
        {
          path: '/hello/work',
          component: () => import('@/views/students/WorkList'),
          name: '作业列表',
          iconClass: 'fa fa-list',
        },

      ]
    },
    {
      path: '/hello',
      component: () => import('@/components/HelloWorld'),
      name: '数据分析',
      iconClass: 'fa fa-bar-chart',
      children: [
        {
          path: '/hello/dataview',
          component: () => import('@/views/dataAnalysis/DataView'),
          name: '数据概览',
          iconClass: 'fa fa-bar-chart',
        },
        {
          path: '/hello/map',
          component: () => import('@/views/dataAnalysis/MapView'),
          name: '地图预览',
          iconClass: 'fa fa-bar-chart',
        },
        {
          path: '/hello/travel',
          component: () => import('@/views/dataAnalysis/TravelMap'),
          name: '旅游地图',
          iconClass: 'fa fa-bar-chart',
        },

      ]
    },
    {
      path: '/hello',
      component: () => import('@/components/HelloWorld'),
      name: '用户中心',
      iconClass: 'fa fa-user',
      children:[
        {
          path: '/hello/user',
          component: () => import('@/views/users/User'),
          name: '权限管理',
          iconClass: 'fa fa-user',
        },
      ]
    }
    
  ],
  mode: 'history'
})